
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>YUI Library Examples: Widget: Creating Custom Widget Classes</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    	<link rel="stylesheet" type="text/css" href="../../assets/yui.css" >

<style>
    /*Supplemental CSS for the YUI distribution*/
    #custom-doc { width: 95%; min-width: 950px; }
    #pagetitle {background-image: url(../../assets/bg_hd.gif);}
/*    #pagetitle h1 {background-image: url(../../assets/title_h_bg.gif);}*/
</style>

<link rel="stylesheet" type="text/css" href="../../assets/dpSyntaxHighlighter.css">
<link type="text/css" rel="stylesheet" href="../../build/cssfonts/fonts-min.css" />
<script type="text/javascript" src="../../build/yui/yui-min.js"></script>
<style type="text/css">

/* Standard Module Widget CSS */
.yui3-standardmodule-hidden {
    display:none;
}

.yui3-standardmodule {
    margin:10px;
}

.yui3-standardmodule-content {
    padding:3px;
    border:1px solid #666;
}

.yui3-standardmodule-content .yui3-widget-hd {
    padding:5px;
    border:2px solid #aa0000;
    background-color:#fff;
    overflow:auto;
}

.yui3-standardmodule-content .yui3-widget-bd {
    padding:5px;
    border:2px solid #0000aa;
    background-color:#fff;
    overflow:auto;
}

.yui3-standardmodule-content .yui3-widget-ft {
    padding:5px;
    border:2px solid #00aa00;
    background-color:#fff;
    overflow:auto;
}

/* Positionable Widget CSS */
.yui3-positionable {
    position:absolute;
}

.yui3-positionable-content {
    text-align:center;
    border:1px solid #000;
    background-color:#999966;
    color:#fff;
    padding:10px;
}

.yui3-positionable-hidden {
    visibility:hidden;
}

/* Alignable Widget CSS */
.yui3-alignable {
    position:absolute;
}

.yui3-alignable-content {
    text-align:center;
    border:1px solid #000000;
    background-color:#004C6D;
    color:#fff;
    padding:2px;
}

.yui3-alignable-hidden {
    visibility:hidden;
}


/* Example Layout CSS */
.widget-build-example {
    border:1px solid #000;
    background-color:#eee;
    padding:5px;
    margin:10px 0;
}

.widget-build-example button, .widget-build-example label, .widget-build-example select, .widget-build-example input {
    margin-right:5px;
}

.widget-build-example button.fail {
    color:#cc0000;
    margin-left:10px;
}

.widget-build-example .filler {
    color:#999;
}

#x, #y {
    width:3em;
}

#widget2-example, #widget3-example {
    height:15em;
}

#widget2-example select, #widget3-example select {
    width:100%;
}

#alignment p {
    color:#dddd00;
}
</style>
</head>
<body id="yahoo-com" class="yui3-skin-sam  yui-skin-sam">
<div id="custom-doc" class="yui-t2">
<div id="hd">
	<div id="ygunav">
		<p>
            <em>
                <a href="http://developer.yahoo.com/yui/3/">YUI 3.x Home</a> <i> - </i>	
            </em>
		</p>
		<form action="http://search.yahoo.com/search" id="sitesearchform">
            <input name="vs" type="hidden" value="developer.yahoo.com">
            <input name="vs" type="hidden" value="yuiblog.com">
			<input name="vs" type="hidden" value="yuilibrary.com">
		    <div id="sitesearch">
		    	<label for="searchinput">Site Search (YDN, YUILibrary &amp; YUIBlog): </label>
			    <input type="text" id="searchinput" name="p">
			    <input type="submit" value="Search" id="searchsubmit" class="ygbt">
		    </div>
		</form>
    </div>
	<div id="ygma"><a href="../../"><img src="../../assets/logo.gif"  border="0" width="200" height="93"></a></div>
	<div id="pagetitle"><h1>YUI Library Examples: Widget: Creating Custom Widget Classes</h1></div>
</div>
<div id="bd">


	<div id="yui-main">
		<div class="yui-b">
		  <div class="yui-ge">
			  <div class="yui-u first example" id="main">

	<h2>Widget: Creating Custom Widget Classes</h2>

	<div id="example" class="promo">
	<div class="example-intro">
	This example shows how you can mix and match the <code>WidgetPosition</code>, <code>WidgetPositionAlign</code>, <code>WidgetStack</code> and <code>WidgetStdMod</code> extensions to build custom versions of the <code>Widget</code> class, using <code>Base.create</code>.
	</div>

	<div class="module example-container ">
			<div class="hd exampleHd">
			<p class="newWindowButton yui-skin-sam">
                <a href="widget-build_clean.html" target="_blank">View example in new window.</a>
            </p>
		</div>		<div id="example-canvas" class="bd">

	
	<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->

	
<ol>
    <li><code>Widget</code> with <code>WidgetStdMod</code>

        <div class="widget-build-example" id="widget1-example">
            <input type="text" id="content" value="">
            <select id="section">
                <option value="header">Header</option>
                <option value="body">Body</option>
                <option value="footer">Footer</option>
            </select>
            <button type="button" id="setContent">Set Content</button>
            <button type="button" class="fail" id="tryMove">move() (should fail)</button>
        
            <div id="widget1">
                <div class="yui3-widget-hd">Module Header</div>
                <div class="yui3-widget-bd">Module Body</div>
                <div class="yui3-widget-ft">Module Footer</div>
            </div>
        
            <p class="filler">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc pretium quam eu mi varius pulvinar. Duis orci arcu, ullamcorper sit amet, luctus ut, interdum ac, quam.</p>
        </div>
    </li>

    <li><code>Widget</code> with <code>WidgetPosition, WidgetStack</code>

        <div class="widget-build-example" id="widget2-example">
            <label>X: <input type="text" id="x" value="0" ></label>
            <label>Y: <input type="text" id="y" value="0" ></label>
            <button type="button" id="move">Move</button>
            <button type="button" class="fail" id="tryContent">setStdModContent() (should fail)</button>

            <div id="widget2"><strong>Positionable Widget</strong></div>

            <p class="filler">
                <select>
                    <option>Prevent IE6 Bleedthrough</option>
                </select>
                Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc pretium quam eu mi varius pulvinar. Duis orci arcu, ullamcorper sit amet, luctus ut, interdum ac, quam. Pellentesque euismod. Nam tincidunt, purus in ultrices congue, urna neque posuere arcu, aliquam tristique purus sapien id nulla. Etiam rhoncus nulla at leo. Cras scelerisque nisl in nibh. Sed eget odio. Morbi elit elit, porta a, convallis sit amet, rhoncus non, felis. Mauris nulla pede, pretium eleifend, porttitor at, rutrum id, orci. Quisque non urna. Nulla aliquam rhoncus est. 
            </p>
        </div>
    </li>
    
    <li><code>Widget</code> with <code>WidgetPosition, WidgetStack, WidgetPositionAlign</code></strong>

        <div class="widget-build-example" id="widget3-example">
            <button type="button" id="run">Run Through Alignment</button>
            <p class="filler">
                <select>
                    <option>Prevent IE6 Bleedthrough</option>
                </select>
                Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc pretium quam eu mi varius pulvinar. Duis orci arcu, ullamcorper sit amet, luctus ut, interdum ac, quam. Pellentesque euismod. Nam tincidunt, purus in ultrices congue, urna neque posuere arcu, aliquam tristique purus sapien id nulla. Etiam rhoncus nulla at leo. Cras scelerisque nisl in nibh. Sed eget odio. Morbi elit elit, porta a, convallis sit amet, rhoncus non, felis. Mauris nulla pede, pretium eleifend, porttitor at, rutrum id, orci. Quisque non urna. Nulla aliquam rhoncus est.
            </p>
        </div>
    </li>
</ol>


<script type="text/javascript">
YUI({ filter: 'raw' }).use("widget", "widget-position", "widget-stack", "widget-position-align", "widget-stdmod", "async-queue", function(Y) {



    // WIDGET 1 : Build Widget with StdMod, but no positioning/stacking support.

    var StandardModule = Y.Base.create("standardModule", Y.Widget, [Y.WidgetStdMod]);

    var stdmod = new StandardModule({
        srcNode: "#widget1",
        width:"12em",
        height:"12em"
    });
    stdmod.render();

    var contentInput = Y.one("#content");
    var sectionInput = Y.one("#section");

    Y.on("click", function(e) {
        var content = contentInput.get("value");
        var section = sectionInput.get("value");

        stdmod.setStdModContent(section, content);

    }, "#setContent");

    Y.on("click", function(e) {
        try {
            stdmod.move([0,0]);
        } catch (e) {
            alert("move() is " + typeof stdmod.move + ", stdmod.hasImpl(Y.WidgetPosition) : " + stdmod.hasImpl(Y.WidgetPosition));
        }
    }, "#tryMove");

    // WIDGET 2: Build Widget with Position support and Stack support, but no StdMod support or Position Extras support.

    var Positionable = Y.Base.create("positionable", Y.Widget, [Y.WidgetPosition, Y.WidgetStack]);

    var positionable = new Positionable({
        srcNode: "#widget2",
        width:"10em",
        zIndex:1
    });
    positionable.render("#widget2-example");

    var xy = Y.one("#widget2-example > p").getXY();

    positionable.move(xy[0], xy[1]);

    var xInput = Y.one("#x");
    var yInput = Y.one("#y");

    xInput.set("value", Math.round(xy[0]));
    yInput.set("value", Math.round(xy[1]));

    Y.on("click", function(e) {
        var x = parseInt(xInput.get("value"));
        var y = parseInt(yInput.get("value"));

        positionable.move(x,y);

    }, "#move");

    Y.on("click", function(e) {
        try {
            positionable.setStdModContent("header", "new content");
        } catch (e) {
            alert("setStdModContent() is " + typeof positionable.setStdModContent + ", positionable.hasImpl(Y.WidgetStdMod) : " + positionable.hasImpl(Y.WidgetStdMod));
        }
    }, "#tryContent");



    // WIDGET 3: Build Widget with Position, PositionExt and Stack support, but no StdMod support.

    var Alignable = Y.Base.create("alignable", Y.Widget, [Y.WidgetPosition, Y.WidgetPositionAlign, Y.WidgetStack]);

    var alignable = new Alignable({
        width:"13em",
        align : {
            node: "#widget3-example",
            points: ["cc", "cc"]
        },
        zIndex:1
    });
    alignable.get("contentBox").set("innerHTML", '<strong>Alignable Widget</strong><div id="alignment"><p>#widget3-example</p><p>[center, center]</p></div>');
    alignable.render("#widget3-example");

    Y.on('click', function() {
        var stepDelay = 2500;
        var currAlignment = Y.one("#alignment");
        var steps = [
            function() {
                alignable.set("align", {node:"#widget3-example", points:["lc", "rc"]});
                currAlignment.set("innerHTML", "<p>#widget3-example</p><p>[left-center, right-center]</p>");
            },
            function() {
                alignable.set("align", {node:"#widget3-example", points:["tr", "br"]});
                currAlignment.set("innerHTML", "<p>#widget3-example</p><p>[top-right, bottom-right]</p>");
            },
            function() {
                alignable.set("centered", "#widget3-example");
                currAlignment.set("innerHTML", "<p>#widget3-example</p><p>centered</p>");
            },
            function() {
                alignable.set("align", {points:["rc", "rc"]});
                currAlignment.set("innerHTML", "<p>viewport</p><p>[right-center, right-center]</p>");
            },
            function() {
                alignable.set("centered", true);
                currAlignment.set("innerHTML", "<p>viewport</p><p>centered</p>");
            },
            function() {
                alignable.set("align", {node:"#widget3-example", points:["cc", "cc"]});
                currAlignment.set("innerHTML", "<p>#widget3-example</p><p>[center, center]</p>");
            }
        ];
    
        var q = new Y.AsyncQueue();
        for (var i = 0; i < steps.length; i++){
            q.add({
                timeout: (i === 0) ? 0 : stepDelay,
                fn:steps[i]
            });
        }
        q.run();

    }, "#run");

});
</script>

	<!--END SOURCE CODE FOR EXAMPLE =============================== -->

	
		</div>
	</div>
	</div>

	<h3>Creating Custom Widget Classes</h3>

<p>The <code>Base</code> class provides a <code>create</code> method which can be used to create custom versions of classes which derive from <code>Base</code> by adding extension classes to them.</p>

<p>Widget currently ships with four such extensions: <code>WidgetPosition</code>, <code>WidgetStack</code>, <code>WidgetPositionAlign</code> and <code>WidgetStdMod</code>.
These extensions are used to create the basic <code>Overlay</code> widget, but can also be used individually, to create custom versions of the base <code>Widget</code> class.</p>

<h3>Widget with WidgetStdMod support</h3>

<p>Adding the <code>WidgetStdMod</code> extension to Widget, creates a statically positioned Widget, with support for standard module format sections - header, body and footer, which maybe useful in portal type use cases, where the positioning/stacking capabilities which come bundled with Overlay are not required.</p>

<p>To create a custom class, we use <a href="../../api/Base.html#method_Base.create"><code>Base.create</code></a>, which is described in detail on the documention page for <a href="http://developer.yahoo.com/yui/3/base/#extensions">Base</a>.</p>

<p>We pass in <code>Widget</code> as the main class we want to add extensions to, and <code>WidgetStdMod</code> as the extension we'd like added to the main class:</p>

<div id="syntax-ecc3def1c7413299f836ac4d51a50d5c" class="yui-syntax-highlight"><div class="numbers"><pre class="javascript" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="kw2">var</span> StandardModule <span class="sy0">=</span> Y.<span class="me1">Base</span>.<span class="me1">create</span><span class="br0">&#40;</span><span class="st0">&quot;standardModule&quot;</span><span class="sy0">,</span> Y.<span class="me1">Widget</span><span class="sy0">,</span> <span class="br0">&#91;</span>Y.<span class="me1">WidgetStdMod</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="co1">// Render from Markup</span></div></li><li class="li1"><div class="de1"><span class="kw2">var</span> stdmod <span class="sy0">=</span> <span class="kw2">new</span> StandardModule<span class="br0">&#40;</span><span class="br0">&#123;</span></div></li><li class="li2"><div class="de2">    contentBox<span class="sy0">:</span> <span class="st0">&quot;#widget1&quot;</span><span class="sy0">,</span></div></li><li class="li1"><div class="de1">    width<span class="sy0">:</span><span class="st0">&quot;12em&quot;</span><span class="sy0">,</span></div></li><li class="li1"><div class="de1">    height<span class="sy0">:</span><span class="st0">&quot;12em&quot;</span></div></li><li class="li1"><div class="de1"><span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">stdmod.<span class="me1">render</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li></ol></pre></div><div class="nonumbers"><pre class="javascript" style="font-family:monospace;"><span class="kw2">var</span> StandardModule <span class="sy0">=</span> Y.<span class="me1">Base</span>.<span class="me1">create</span><span class="br0">&#40;</span><span class="st0">&quot;standardModule&quot;</span><span class="sy0">,</span> Y.<span class="me1">Widget</span><span class="sy0">,</span> <span class="br0">&#91;</span>Y.<span class="me1">WidgetStdMod</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="co1">// Render from Markup</span>
<span class="kw2">var</span> stdmod <span class="sy0">=</span> <span class="kw2">new</span> StandardModule<span class="br0">&#40;</span><span class="br0">&#123;</span>
    contentBox<span class="sy0">:</span> <span class="st0">&quot;#widget1&quot;</span><span class="sy0">,</span>
    width<span class="sy0">:</span><span class="st0">&quot;12em&quot;</span><span class="sy0">,</span>
    height<span class="sy0">:</span><span class="st0">&quot;12em&quot;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
stdmod.<span class="me1">render</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div><textarea id="syntax-ecc3def1c7413299f836ac4d51a50d5c-plain">var StandardModule = Y.Base.create("standardModule", Y.Widget, [Y.WidgetStdMod]);

// Render from Markup
var stdmod = new StandardModule({
    contentBox: "#widget1",
    width:"12em",
    height:"12em"
});
stdmod.render();</textarea></div>
<p><code>Base.create</code> will:</p>
<ol>
    <li>Create a new class which extends <code>Widget</code></li>
    <li>Aggregate known <code>Base</code> and <code>Widget</code> fields, such as <code>ATTRS</code> and <code>HTML_PARSER</code> from <code>WidgetStdMod</code> on the new class</li>
    <li>Augment prototype methods from <code>WidgetStdMod</code> onto the new class prototype</li>
</ol>

<p>The first argument to create is the <code>NAME</code> of the new class we are creating, just like the <code>NAME</code> we define when extending the Widget class directly.</p>

<p>Note that the <code>Widget</code> class is unchanged, allowing you to still create <code>Widget</code> instances without any standard module support, along with <code>StandardModule</code> instances which have standard module support.</p>

<h4>Testing It Out</h4>

<p>The example attempts to set content on an instance of the newly created <code>StandardModule</code> class, using the <code>setStdModContent</code> method which is added by the extension (which would otherwise not exist on the Widget instance).</p>

<div id="syntax-0c78f50c2f9d3ade98afbb8737738cac" class="yui-syntax-highlight"><div class="numbers"><pre class="javascript" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="kw2">var</span> contentInput <span class="sy0">=</span> Y.<span class="me1">one</span><span class="br0">&#40;</span><span class="st0">&quot;#content&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1"><span class="kw2">var</span> sectionInput <span class="sy0">=</span> Y.<span class="me1">one</span><span class="br0">&#40;</span><span class="st0">&quot;#section&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="co1">// This should work, since the StandardModule widget has settable </span></div></li><li class="li2"><div class="de2"><span class="co1">// header/body/footer sections</span></div></li><li class="li1"><div class="de1">Y.<span class="me1">on</span><span class="br0">&#40;</span><span class="st0">&quot;click&quot;</span><span class="sy0">,</span> <span class="kw2">function</span><span class="br0">&#40;</span>e<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1">    <span class="kw2">var</span> content <span class="sy0">=</span> contentInput.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">&quot;value&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">    <span class="kw2">var</span> section <span class="sy0">=</span> sectionInput.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">&quot;value&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li2"><div class="de2">&nbsp;</div></li><li class="li1"><div class="de1">    stdmod.<span class="me1">setStdModContent</span><span class="br0">&#40;</span>section<span class="sy0">,</span> content<span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="br0">&#125;</span><span class="sy0">,</span> <span class="st0">&quot;#setContent&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li></ol></pre></div><div class="nonumbers"><pre class="javascript" style="font-family:monospace;"><span class="kw2">var</span> contentInput <span class="sy0">=</span> Y.<span class="me1">one</span><span class="br0">&#40;</span><span class="st0">&quot;#content&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw2">var</span> sectionInput <span class="sy0">=</span> Y.<span class="me1">one</span><span class="br0">&#40;</span><span class="st0">&quot;#section&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="co1">// This should work, since the StandardModule widget has settable </span>
<span class="co1">// header/body/footer sections</span>
Y.<span class="me1">on</span><span class="br0">&#40;</span><span class="st0">&quot;click&quot;</span><span class="sy0">,</span> <span class="kw2">function</span><span class="br0">&#40;</span>e<span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp;
    <span class="kw2">var</span> content <span class="sy0">=</span> contentInput.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">&quot;value&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="kw2">var</span> section <span class="sy0">=</span> sectionInput.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">&quot;value&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
    stdmod.<span class="me1">setStdModContent</span><span class="br0">&#40;</span>section<span class="sy0">,</span> content<span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="br0">&#125;</span><span class="sy0">,</span> <span class="st0">&quot;#setContent&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div><textarea id="syntax-0c78f50c2f9d3ade98afbb8737738cac-plain">var contentInput = Y.one("#content");
var sectionInput = Y.one("#section");

// This should work, since the StandardModule widget has settable 
// header/body/footer sections
Y.on("click", function(e) {

    var content = contentInput.get("value");
    var section = sectionInput.get("value");

    stdmod.setStdModContent(section, content);

}, "#setContent");</textarea></div>
<p>To verify that no unrequested features are added, we also attempt to move the instance using the <code>move</code> method, which is not part of the base Widget class, and would be added by the <code>WidgetPosition</code> extension. This verifies that the other example classes we'll create, which do create new classes which use <code>WidgetPosition</code>, have not modified the base Widget class.</p>

<div id="syntax-80baa19cdf73252cf5428c1c1f0440b1" class="yui-syntax-highlight"><div class="numbers"><pre class="javascript" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="co1">// This shoud fail, since the StandardModule widget is not positionable</span></div></li><li class="li1"><div class="de1">Y.<span class="me1">on</span><span class="br0">&#40;</span><span class="st0">&quot;click&quot;</span><span class="sy0">,</span> <span class="kw2">function</span><span class="br0">&#40;</span>e<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">    <span class="kw1">try</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">        stdmod.<span class="me1">move</span><span class="br0">&#40;</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="sy0">,</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li2"><div class="de2">    <span class="br0">&#125;</span> <span class="kw1">catch</span> <span class="br0">&#40;</span>e<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">        <span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">&quot;move() is &quot;</span> <span class="sy0">+</span> <span class="kw1">typeof</span> stdmod.<span class="me1">move</span> <span class="sy0">+</span> <span class="st0">&quot;, stdmod.hasImpl(Y.WidgetPosition) : &quot;</span></div></li><li class="li1"><div class="de1">        <span class="sy0">+</span> stdmod.<span class="me1">hasImpl</span><span class="br0">&#40;</span>Y.<span class="me1">WidgetPosition</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">    <span class="br0">&#125;</span></div></li><li class="li1"><div class="de1"><span class="br0">&#125;</span><span class="sy0">,</span> <span class="st0">&quot;#tryMove&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li></ol></pre></div><div class="nonumbers"><pre class="javascript" style="font-family:monospace;"><span class="co1">// This shoud fail, since the StandardModule widget is not positionable</span>
Y.<span class="me1">on</span><span class="br0">&#40;</span><span class="st0">&quot;click&quot;</span><span class="sy0">,</span> <span class="kw2">function</span><span class="br0">&#40;</span>e<span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="kw1">try</span> <span class="br0">&#123;</span>
        stdmod.<span class="me1">move</span><span class="br0">&#40;</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="sy0">,</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span> <span class="kw1">catch</span> <span class="br0">&#40;</span>e<span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">&quot;move() is &quot;</span> <span class="sy0">+</span> <span class="kw1">typeof</span> stdmod.<span class="me1">move</span> <span class="sy0">+</span> <span class="st0">&quot;, stdmod.hasImpl(Y.WidgetPosition) : &quot;</span>
        <span class="sy0">+</span> stdmod.<span class="me1">hasImpl</span><span class="br0">&#40;</span>Y.<span class="me1">WidgetPosition</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span>
<span class="br0">&#125;</span><span class="sy0">,</span> <span class="st0">&quot;#tryMove&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div><textarea id="syntax-80baa19cdf73252cf5428c1c1f0440b1-plain">// This shoud fail, since the StandardModule widget is not positionable
Y.on("click", function(e) {
    try {
        stdmod.move([0,0]);
    } catch (e) {
        alert("move() is " + typeof stdmod.move + ", stdmod.hasImpl(Y.WidgetPosition) : "
        + stdmod.hasImpl(Y.WidgetPosition));
    }
}, "#tryMove");</textarea></div>
<p>Note that <code>Base.create</code> adds a <code>hasImpl</code> method to the built class, which allows you to query whether or not it has a particular extension applied.</p>

<h4>CSS Considerations</h4>

<p>We need to define the CSS which goes with this new <code>StandardModule</code> class we have created. The only rule really required out of the box is the rule which handles visibility (<code>yui-standardmodule-hidden</code>). The "standardmodule" used in the class name comes from the <code>NAME</code> property we set up for the new class, and is used to prefix all state related classes added to the widgets bounding box.
Since the <code>StandardModule</code> class is not positionable, we use <code>display:none</code> to define the <code>hidden</code> state.</p>

<div id="syntax-35f743db16f3ac9cf5b5c3bf962a11ba" class="yui-syntax-highlight"><div class="numbers"><pre class="css" style="font-family:monospace;"><ol><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="coMULTI">/* Visibility - How to handle visibility for this new widget */</span></div></li><li class="li1"><div class="de1"><span class="re1">.yui3-standardmodule-hidden</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">    <span class="kw1">display</span><span class="sy0">:</span><span class="kw2">none</span><span class="sy0">;</span></div></li><li class="li2"><div class="de2"><span class="br0">&#125;</span></div></li></ol></pre></div><div class="nonumbers"><pre class="css" style="font-family:monospace;">&nbsp;
<span class="coMULTI">/* Visibility - How to handle visibility for this new widget */</span>
<span class="re1">.yui3-standardmodule-hidden</span> <span class="br0">&#123;</span>
    <span class="kw1">display</span><span class="sy0">:</span><span class="kw2">none</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre></div><textarea id="syntax-35f743db16f3ac9cf5b5c3bf962a11ba-plain">
/* Visibility - How to handle visibility for this new widget */
.yui3-standardmodule-hidden {
    display:none;
}</textarea></div>
<p>The other "yui-standardmodule" rules are only used to create the required look/feel for this particular example, and do not impact the StandardModule widget's functionality.</p>

<h3>Widget with WidgetPosition and WidgetStack support</h3>

<p>As with <code>StandardModule</code>, we use <code>Base.create</code> to create the new <code>Positionable</code> widget class. This time we add <code>WidgetPosition</code> and <code>WidgetStack</code> support to the base <code>Widget</code> class to create a basic XY positionable widget, with shimming and z-index support.</p>

<div id="syntax-1030421430390c5fa7c7d187c01ee246" class="yui-syntax-highlight"><div class="numbers"><pre class="javascript" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="kw2">var</span> Positionable <span class="sy0">=</span> Y.<span class="me1">Base</span>.<span class="me1">create</span><span class="br0">&#40;</span><span class="st0">&quot;positionable&quot;</span><span class="sy0">,</span> Y.<span class="me1">Widget</span><span class="sy0">,</span> </div></li><li class="li1"><div class="de1">                            <span class="br0">&#91;</span>Y.<span class="me1">WidgetPosition</span><span class="sy0">,</span> Y.<span class="me1">WidgetStack</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="co1">// Render from markup</span></div></li><li class="li2"><div class="de2"><span class="kw2">var</span> positionable <span class="sy0">=</span> <span class="kw2">new</span> Positionable<span class="br0">&#40;</span><span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">    contentBox<span class="sy0">:</span> <span class="st0">&quot;#widget2&quot;</span><span class="sy0">,</span></div></li><li class="li1"><div class="de1">    width<span class="sy0">:</span><span class="st0">&quot;10em&quot;</span><span class="sy0">,</span></div></li><li class="li1"><div class="de1">    height<span class="sy0">:</span><span class="st0">&quot;10em&quot;</span><span class="sy0">,</span></div></li><li class="li1"><div class="de1">    zIndex<span class="sy0">:</span><span class="nu0">1</span></div></li><li class="li2"><div class="de2"><span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">positionable.<span class="me1">render</span><span class="br0">&#40;</span><span class="st0">&quot;#widget2-example&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="kw2">var</span> xy <span class="sy0">=</span> Y.<span class="me1">one</span><span class="br0">&#40;</span><span class="st0">&quot;#widget2-example &gt; p&quot;</span><span class="br0">&#41;</span>.<span class="me1">getXY</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li2"><div class="de2">positionable.<span class="me1">move</span><span class="br0">&#40;</span>xy<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="sy0">,</span> xy<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li></ol></pre></div><div class="nonumbers"><pre class="javascript" style="font-family:monospace;"><span class="kw2">var</span> Positionable <span class="sy0">=</span> Y.<span class="me1">Base</span>.<span class="me1">create</span><span class="br0">&#40;</span><span class="st0">&quot;positionable&quot;</span><span class="sy0">,</span> Y.<span class="me1">Widget</span><span class="sy0">,</span> 
                            <span class="br0">&#91;</span>Y.<span class="me1">WidgetPosition</span><span class="sy0">,</span> Y.<span class="me1">WidgetStack</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="co1">// Render from markup</span>
<span class="kw2">var</span> positionable <span class="sy0">=</span> <span class="kw2">new</span> Positionable<span class="br0">&#40;</span><span class="br0">&#123;</span>
    contentBox<span class="sy0">:</span> <span class="st0">&quot;#widget2&quot;</span><span class="sy0">,</span>
    width<span class="sy0">:</span><span class="st0">&quot;10em&quot;</span><span class="sy0">,</span>
    height<span class="sy0">:</span><span class="st0">&quot;10em&quot;</span><span class="sy0">,</span>
    zIndex<span class="sy0">:</span><span class="nu0">1</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
positionable.<span class="me1">render</span><span class="br0">&#40;</span><span class="st0">&quot;#widget2-example&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="kw2">var</span> xy <span class="sy0">=</span> Y.<span class="me1">one</span><span class="br0">&#40;</span><span class="st0">&quot;#widget2-example &gt; p&quot;</span><span class="br0">&#41;</span>.<span class="me1">getXY</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
positionable.<span class="me1">move</span><span class="br0">&#40;</span>xy<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="sy0">,</span> xy<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div><textarea id="syntax-1030421430390c5fa7c7d187c01ee246-plain">var Positionable = Y.Base.create("positionable", Y.Widget, 
                            [Y.WidgetPosition, Y.WidgetStack]);

// Render from markup
var positionable = new Positionable({
    contentBox: "#widget2",
    width:"10em",
    height:"10em",
    zIndex:1
});
positionable.render("#widget2-example");

var xy = Y.one("#widget2-example > p").getXY();

positionable.move(xy[0], xy[1]);</textarea></div>
<p>We <strong>don't</strong> add <code>WidgetPositionAlign</code> or <code>WidgetStdMod</code> support, so the widget doesn't have extended positioning support (align, center) or standard module support. Hence we position it manually using the <code>move</code> method which the <code>WidgetPosition</code> extension provides.</p>

<h4>Testing It Out</h4>

<p>We should now be able to invoke the <code>move</code> method on an instance of the newly created <code>Positionable</code> class:</p>

<div id="syntax-fb6dedd99e752d50a1f6298a5d5d9911" class="yui-syntax-highlight"><div class="numbers"><pre class="javascript" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="co1">// This should work, since Positionable has basic XY Positioning support</span></div></li><li class="li1"><div class="de1">Y.<span class="me1">on</span><span class="br0">&#40;</span><span class="st0">&quot;click&quot;</span><span class="sy0">,</span> <span class="kw2">function</span><span class="br0">&#40;</span>e<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">    <span class="kw2">var</span> x <span class="sy0">=</span> parseInt<span class="br0">&#40;</span>xInput.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">&quot;value&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">    <span class="kw2">var</span> y <span class="sy0">=</span> parseInt<span class="br0">&#40;</span>yInput.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">&quot;value&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li2"><div class="de2">&nbsp;</div></li><li class="li1"><div class="de1">    positionable.<span class="me1">move</span><span class="br0">&#40;</span>x<span class="sy0">,</span>y<span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="br0">&#125;</span><span class="sy0">,</span> <span class="st0">&quot;#move&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li></ol></pre></div><div class="nonumbers"><pre class="javascript" style="font-family:monospace;"><span class="co1">// This should work, since Positionable has basic XY Positioning support</span>
Y.<span class="me1">on</span><span class="br0">&#40;</span><span class="st0">&quot;click&quot;</span><span class="sy0">,</span> <span class="kw2">function</span><span class="br0">&#40;</span>e<span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="kw2">var</span> x <span class="sy0">=</span> parseInt<span class="br0">&#40;</span>xInput.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">&quot;value&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="kw2">var</span> y <span class="sy0">=</span> parseInt<span class="br0">&#40;</span>yInput.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">&quot;value&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
    positionable.<span class="me1">move</span><span class="br0">&#40;</span>x<span class="sy0">,</span>y<span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="br0">&#125;</span><span class="sy0">,</span> <span class="st0">&quot;#move&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div><textarea id="syntax-fb6dedd99e752d50a1f6298a5d5d9911-plain">// This should work, since Positionable has basic XY Positioning support
Y.on("click", function(e) {
    var x = parseInt(xInput.get("value"));
    var y = parseInt(yInput.get("value"));

    positionable.move(x,y);

}, "#move");</textarea></div>
<p>And, as with the <code>StandardModule</code> class, we should not be allowed to invoke any methods from an extension which we didn't request:</p>

<div id="syntax-b87e35e2bde3886f9f1bca81ccc922b3" class="yui-syntax-highlight"><div class="numbers"><pre class="javascript" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="co1">// This should fail, since Positionable does not have Standard Module sections</span></div></li><li class="li1"><div class="de1">Y.<span class="me1">on</span><span class="br0">&#40;</span><span class="st0">&quot;click&quot;</span><span class="sy0">,</span> <span class="kw2">function</span><span class="br0">&#40;</span>e<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">    <span class="kw1">try</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">        positionable.<span class="me1">setStdModContent</span><span class="br0">&#40;</span><span class="st0">&quot;header&quot;</span><span class="sy0">,</span> <span class="st0">&quot;new content&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li2"><div class="de2">    <span class="br0">&#125;</span> <span class="kw1">catch</span> <span class="br0">&#40;</span>e<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">        <span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">&quot;setStdModContent() is &quot;</span> <span class="sy0">+</span> <span class="kw1">typeof</span> positionable.<span class="me1">setStdModContent</span> <span class="sy0">+</span> </div></li><li class="li1"><div class="de1">            <span class="st0">&quot;, positionable.hasImpl(Y.WidgetStdMod) : &quot;</span> <span class="sy0">+</span> positionable.<span class="me1">hasImpl</span><span class="br0">&#40;</span>Y.<span class="me1">WidgetStdMod</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">    <span class="br0">&#125;</span></div></li><li class="li1"><div class="de1"><span class="br0">&#125;</span><span class="sy0">,</span> <span class="st0">&quot;#tryContent&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li></ol></pre></div><div class="nonumbers"><pre class="javascript" style="font-family:monospace;"><span class="co1">// This should fail, since Positionable does not have Standard Module sections</span>
Y.<span class="me1">on</span><span class="br0">&#40;</span><span class="st0">&quot;click&quot;</span><span class="sy0">,</span> <span class="kw2">function</span><span class="br0">&#40;</span>e<span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="kw1">try</span> <span class="br0">&#123;</span>
        positionable.<span class="me1">setStdModContent</span><span class="br0">&#40;</span><span class="st0">&quot;header&quot;</span><span class="sy0">,</span> <span class="st0">&quot;new content&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span> <span class="kw1">catch</span> <span class="br0">&#40;</span>e<span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">&quot;setStdModContent() is &quot;</span> <span class="sy0">+</span> <span class="kw1">typeof</span> positionable.<span class="me1">setStdModContent</span> <span class="sy0">+</span> 
            <span class="st0">&quot;, positionable.hasImpl(Y.WidgetStdMod) : &quot;</span> <span class="sy0">+</span> positionable.<span class="me1">hasImpl</span><span class="br0">&#40;</span>Y.<span class="me1">WidgetStdMod</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span>
<span class="br0">&#125;</span><span class="sy0">,</span> <span class="st0">&quot;#tryContent&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div><textarea id="syntax-b87e35e2bde3886f9f1bca81ccc922b3-plain">// This should fail, since Positionable does not have Standard Module sections
Y.on("click", function(e) {
    try {
        positionable.setStdModContent("header", "new content");
    } catch (e) {
        alert("setStdModContent() is " + typeof positionable.setStdModContent + 
            ", positionable.hasImpl(Y.WidgetStdMod) : " + positionable.hasImpl(Y.WidgetStdMod));
    }
}, "#tryContent");</textarea></div>
<h4>CSS Considerations</h4>

<p>Since now we have a positionable widget, with z-index support, we set the widget to be absolutely positioned by default, and control it's hidden state using <code>visibility</code> as opposed to <code>display</code></p>

<div id="syntax-fb8926fed26993674ae25d8cf00d432a" class="yui-syntax-highlight"><div class="numbers"><pre class="css" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="coMULTI">/* Define absolute positioning as the default for positionable widgets */</span></div></li><li class="li1"><div class="de1"><span class="re1">.yui3-positionable</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">    <span class="kw1">position</span><span class="sy0">:</span><span class="kw2">absolute</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li><li class="li2"><div class="de2">&nbsp;</div></li><li class="li1"><div class="de1"><span class="coMULTI">/* </span></div></li><li class="li1"><div class="de1"><span class="coMULTI">&nbsp;  In order to be able to position the widget when hidden, we define hidden</span></div></li><li class="li1"><div class="de1"><span class="coMULTI">&nbsp;  to use visibility, as opposed to display</span></div></li><li class="li1"><div class="de1"><span class="coMULTI">*/</span></div></li><li class="li2"><div class="de2"><span class="re1">.yui3-positionable-hidden</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">    <span class="kw1">visibility</span><span class="sy0">:</span><span class="kw2">hidden</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li></ol></pre></div><div class="nonumbers"><pre class="css" style="font-family:monospace;"><span class="coMULTI">/* Define absolute positioning as the default for positionable widgets */</span>
<span class="re1">.yui3-positionable</span> <span class="br0">&#123;</span>
    <span class="kw1">position</span><span class="sy0">:</span><span class="kw2">absolute</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="coMULTI">/* 
   In order to be able to position the widget when hidden, we define hidden
   to use visibility, as opposed to display
*/</span>
<span class="re1">.yui3-positionable-hidden</span> <span class="br0">&#123;</span>
    <span class="kw1">visibility</span><span class="sy0">:</span><span class="kw2">hidden</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre></div><textarea id="syntax-fb8926fed26993674ae25d8cf00d432a-plain">/* Define absolute positioning as the default for positionable widgets */
.yui3-positionable {
    position:absolute;
}

/* 
   In order to be able to position the widget when hidden, we define hidden
   to use visibility, as opposed to display
*/
.yui3-positionable-hidden {
    visibility:hidden;
}</textarea></div>
<h3>Widget with WidgetPosition, WidgetStack and WidgetPositionAlign support</h3>

<p>Lastly, we'll attempt to create a new widget class, which, in addition to basic positioning and stacking support, also has extended positioning support, allowing us to align it with other elements on the page.</p>

<p>Again, we use <code>Base.create</code> to create our new <code>Alignable</code> widget class, by combining <code>WidgetPosition</code>, <code>WidgetStack</code> and <code>WidgetPositionAlign</code> with the base widget class:</p>

<div id="syntax-4e6a5d02ce8c558e9b29348589922b33" class="yui-syntax-highlight"><div class="numbers"><pre class="javascript" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="kw2">var</span> Alignable <span class="sy0">=</span> Y.<span class="me1">Base</span>.<span class="me1">create</span><span class="br0">&#40;</span><span class="st0">&quot;alignable&quot;</span><span class="sy0">,</span> Y.<span class="me1">Widget</span><span class="sy0">,</span> </div></li><li class="li1"><div class="de1">                    <span class="br0">&#91;</span>Y.<span class="me1">WidgetPosition</span><span class="sy0">,</span> Y.<span class="me1">WidgetPositionAlign</span><span class="sy0">,</span> Y.<span class="me1">WidgetStack</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="kw2">var</span> alignable <span class="sy0">=</span> <span class="kw2">new</span> Alignable<span class="br0">&#40;</span><span class="br0">&#123;</span></div></li><li class="li2"><div class="de2">    width<span class="sy0">:</span><span class="st0">&quot;13em&quot;</span><span class="sy0">,</span></div></li><li class="li1"><div class="de1">    align <span class="sy0">:</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">        node<span class="sy0">:</span> <span class="st0">&quot;#widget3-example&quot;</span><span class="sy0">,</span></div></li><li class="li1"><div class="de1">        points<span class="sy0">:</span> <span class="br0">&#91;</span><span class="st0">&quot;cc&quot;</span><span class="sy0">,</span> <span class="st0">&quot;cc&quot;</span><span class="br0">&#93;</span></div></li><li class="li1"><div class="de1">    <span class="br0">&#125;</span><span class="sy0">,</span></div></li><li class="li2"><div class="de2">    zIndex<span class="sy0">:</span><span class="nu0">1</span></div></li><li class="li1"><div class="de1"><span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">alignable.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">&quot;contentBox&quot;</span><span class="br0">&#41;</span>.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;innerHTML&quot;</span><span class="sy0">,</span> </div></li><li class="li1"><div class="de1">    <span class="st0">'&lt;strong&gt;Alignable Widget&lt;/strong&gt;&lt;div id=&quot;alignment&quot;&gt;&lt;p&gt;#widget3-example&lt;/p&gt; <span class="es0">\</span></span></div></li><li class="li1"><div class="de1"><span class="st0">    &lt;p&gt;[center, center]&lt;/p&gt;&lt;/div&gt;'</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li2"><div class="de2">alignable.<span class="me1">render</span><span class="br0">&#40;</span><span class="st0">&quot;#widget3-example&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li></ol></pre></div><div class="nonumbers"><pre class="javascript" style="font-family:monospace;"><span class="kw2">var</span> Alignable <span class="sy0">=</span> Y.<span class="me1">Base</span>.<span class="me1">create</span><span class="br0">&#40;</span><span class="st0">&quot;alignable&quot;</span><span class="sy0">,</span> Y.<span class="me1">Widget</span><span class="sy0">,</span> 
                    <span class="br0">&#91;</span>Y.<span class="me1">WidgetPosition</span><span class="sy0">,</span> Y.<span class="me1">WidgetPositionAlign</span><span class="sy0">,</span> Y.<span class="me1">WidgetStack</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="kw2">var</span> alignable <span class="sy0">=</span> <span class="kw2">new</span> Alignable<span class="br0">&#40;</span><span class="br0">&#123;</span>
    width<span class="sy0">:</span><span class="st0">&quot;13em&quot;</span><span class="sy0">,</span>
    align <span class="sy0">:</span> <span class="br0">&#123;</span>
        node<span class="sy0">:</span> <span class="st0">&quot;#widget3-example&quot;</span><span class="sy0">,</span>
        points<span class="sy0">:</span> <span class="br0">&#91;</span><span class="st0">&quot;cc&quot;</span><span class="sy0">,</span> <span class="st0">&quot;cc&quot;</span><span class="br0">&#93;</span>
    <span class="br0">&#125;</span><span class="sy0">,</span>
    zIndex<span class="sy0">:</span><span class="nu0">1</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
alignable.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">&quot;contentBox&quot;</span><span class="br0">&#41;</span>.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;innerHTML&quot;</span><span class="sy0">,</span> 
    <span class="st0">'&lt;strong&gt;Alignable Widget&lt;/strong&gt;&lt;div id=&quot;alignment&quot;&gt;&lt;p&gt;#widget3-example&lt;/p&gt; <span class="es0">\</span>
    &lt;p&gt;[center, center]&lt;/p&gt;&lt;/div&gt;'</span><span class="br0">&#41;</span><span class="sy0">;</span>
alignable.<span class="me1">render</span><span class="br0">&#40;</span><span class="st0">&quot;#widget3-example&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div><textarea id="syntax-4e6a5d02ce8c558e9b29348589922b33-plain">var Alignable = Y.Base.create("alignable", Y.Widget, 
                    [Y.WidgetPosition, Y.WidgetPositionAlign, Y.WidgetStack]);

var alignable = new Alignable({
    width:"13em",
    align : {
        node: "#widget3-example",
        points: ["cc", "cc"]
    },
    zIndex:1
});
alignable.get("contentBox").set("innerHTML", 
    '<strong>Alignable Widget</strong><div id="alignment"><p>#widget3-example</p> \
    <p>[center, center]</p></div>');
alignable.render("#widget3-example");</textarea></div>
<h4>Testing It Out</h4>

<p>We'll attempt to align an instance of the <code>Alignable</code> class, using some of the additional attributes which <code>WidgetPositionAlign</code> adds to the base <code>Widget</code> class: <code>align</code> and <code>centered</code>:</p>

<div id="syntax-e8c9d351a093b1beb7395db638f0a400" class="yui-syntax-highlight"><div class="numbers"><pre class="javascript" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="co1">// Align left-center egde of widget to </span></div></li><li class="li1"><div class="de1"><span class="co1">// right-center edge of the node with id &quot;widget3-example&quot;</span></div></li><li class="li1"><div class="de1">alignable.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;align&quot;</span><span class="sy0">,</span> <span class="br0">&#123;</span>node<span class="sy0">:</span><span class="st0">&quot;#widget3-example&quot;</span><span class="sy0">,</span> points<span class="sy0">:</span><span class="br0">&#91;</span><span class="st0">&quot;lc&quot;</span><span class="sy0">,</span> <span class="st0">&quot;rc&quot;</span><span class="br0">&#93;</span><span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li2"><div class="de2"><span class="co1">// Align top-right corner of widget to </span></div></li><li class="li1"><div class="de1"><span class="co1">// bottom-right corner of the node with id &quot;widget3-example&quot;</span></div></li><li class="li1"><div class="de1">alignable.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;align&quot;</span><span class="sy0">,</span> <span class="br0">&#123;</span>node<span class="sy0">:</span><span class="st0">&quot;#widget3-example&quot;</span><span class="sy0">,</span> points<span class="sy0">:</span><span class="br0">&#91;</span><span class="st0">&quot;tr&quot;</span><span class="sy0">,</span> <span class="st0">&quot;br&quot;</span><span class="br0">&#93;</span><span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="co1">// Center the widget in the node with id &quot;widget3-example&quot;</span></div></li><li class="li2"><div class="de2">alignable.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;centered&quot;</span><span class="sy0">,</span> <span class="st0">&quot;widget3-example&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="co1">// Align the right-center edge of the widget to </span></div></li><li class="li1"><div class="de1"><span class="co1">// the right center edge of the viewport (since a node is not provided to 'align')</span></div></li><li class="li1"><div class="de1">alignable.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;align&quot;</span><span class="sy0">,</span> <span class="br0">&#123;</span>points<span class="sy0">:</span><span class="br0">&#91;</span><span class="st0">&quot;rc&quot;</span><span class="sy0">,</span> <span class="st0">&quot;rc&quot;</span><span class="br0">&#93;</span><span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li2"><div class="de2">&nbsp;</div></li><li class="li1"><div class="de1"><span class="co1">// Center the widget in the viewport (wince a node is not provided to 'centered')</span></div></li><li class="li1"><div class="de1">alignable.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;centered&quot;</span><span class="sy0">,</span> <span class="kw2">true</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="co1">// Return the node to it's original alignment </span></div></li><li class="li2"><div class="de2"><span class="co1">// (centered in the node with id &quot;widget3-example&quot;)</span></div></li><li class="li1"><div class="de1"><span class="co1">// NOTE: centered is a shortcut for align : { points:[&quot;cc&quot;, &quot;cc&quot;] }</span></div></li><li class="li1"><div class="de1">alignable.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;align&quot;</span><span class="sy0">,</span> <span class="br0">&#123;</span>node<span class="sy0">:</span><span class="st0">&quot;#widget3-example&quot;</span><span class="sy0">,</span> points<span class="sy0">:</span><span class="br0">&#91;</span><span class="st0">&quot;cc&quot;</span><span class="sy0">,</span> <span class="st0">&quot;cc&quot;</span><span class="br0">&#93;</span><span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li></ol></pre></div><div class="nonumbers"><pre class="javascript" style="font-family:monospace;"><span class="co1">// Align left-center egde of widget to </span>
<span class="co1">// right-center edge of the node with id &quot;widget3-example&quot;</span>
alignable.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;align&quot;</span><span class="sy0">,</span> <span class="br0">&#123;</span>node<span class="sy0">:</span><span class="st0">&quot;#widget3-example&quot;</span><span class="sy0">,</span> points<span class="sy0">:</span><span class="br0">&#91;</span><span class="st0">&quot;lc&quot;</span><span class="sy0">,</span> <span class="st0">&quot;rc&quot;</span><span class="br0">&#93;</span><span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="co1">// Align top-right corner of widget to </span>
<span class="co1">// bottom-right corner of the node with id &quot;widget3-example&quot;</span>
alignable.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;align&quot;</span><span class="sy0">,</span> <span class="br0">&#123;</span>node<span class="sy0">:</span><span class="st0">&quot;#widget3-example&quot;</span><span class="sy0">,</span> points<span class="sy0">:</span><span class="br0">&#91;</span><span class="st0">&quot;tr&quot;</span><span class="sy0">,</span> <span class="st0">&quot;br&quot;</span><span class="br0">&#93;</span><span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="co1">// Center the widget in the node with id &quot;widget3-example&quot;</span>
alignable.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;centered&quot;</span><span class="sy0">,</span> <span class="st0">&quot;widget3-example&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="co1">// Align the right-center edge of the widget to </span>
<span class="co1">// the right center edge of the viewport (since a node is not provided to 'align')</span>
alignable.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;align&quot;</span><span class="sy0">,</span> <span class="br0">&#123;</span>points<span class="sy0">:</span><span class="br0">&#91;</span><span class="st0">&quot;rc&quot;</span><span class="sy0">,</span> <span class="st0">&quot;rc&quot;</span><span class="br0">&#93;</span><span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="co1">// Center the widget in the viewport (wince a node is not provided to 'centered')</span>
alignable.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;centered&quot;</span><span class="sy0">,</span> <span class="kw2">true</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="co1">// Return the node to it's original alignment </span>
<span class="co1">// (centered in the node with id &quot;widget3-example&quot;)</span>
<span class="co1">// NOTE: centered is a shortcut for align : { points:[&quot;cc&quot;, &quot;cc&quot;] }</span>
alignable.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;align&quot;</span><span class="sy0">,</span> <span class="br0">&#123;</span>node<span class="sy0">:</span><span class="st0">&quot;#widget3-example&quot;</span><span class="sy0">,</span> points<span class="sy0">:</span><span class="br0">&#91;</span><span class="st0">&quot;cc&quot;</span><span class="sy0">,</span> <span class="st0">&quot;cc&quot;</span><span class="br0">&#93;</span><span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div><textarea id="syntax-e8c9d351a093b1beb7395db638f0a400-plain">// Align left-center egde of widget to 
// right-center edge of the node with id "widget3-example"
alignable.set("align", {node:"#widget3-example", points:["lc", "rc"]});

// Align top-right corner of widget to 
// bottom-right corner of the node with id "widget3-example"
alignable.set("align", {node:"#widget3-example", points:["tr", "br"]});

// Center the widget in the node with id "widget3-example"
alignable.set("centered", "widget3-example");

// Align the right-center edge of the widget to 
// the right center edge of the viewport (since a node is not provided to 'align')
alignable.set("align", {points:["rc", "rc"]});

// Center the widget in the viewport (wince a node is not provided to 'centered')
alignable.set("centered", true);

// Return the node to it's original alignment 
// (centered in the node with id "widget3-example")
// NOTE: centered is a shortcut for align : { points:["cc", "cc"] }
alignable.set("align", {node:"#widget3-example", points:["cc", "cc"]});</textarea></div>
<h4>CSS Considerations</h4>

<p>The <code>Alignable</code> widget class, has the same core CSS rules as the <code>Positionable</code> class, to define how it is positioned and how it is hidden:</p>

<div id="syntax-b4a0d7b80d345608e0ab07777b8e7f85" class="yui-syntax-highlight"><div class="numbers"><pre class="css" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="coMULTI">/* Define absolute positioning as the default for alignable widgets */</span></div></li><li class="li1"><div class="de1"><span class="re1">.yui3-alignable</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">    <span class="kw1">position</span><span class="sy0">:</span><span class="kw2">absolute</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li><li class="li2"><div class="de2">&nbsp;</div></li><li class="li1"><div class="de1"><span class="coMULTI">/* </span></div></li><li class="li1"><div class="de1"><span class="coMULTI">&nbsp;  In order to be able to position the widget when hidden, we define hidden</span></div></li><li class="li1"><div class="de1"><span class="coMULTI">&nbsp;  to use visibility, as opposed to display</span></div></li><li class="li1"><div class="de1"><span class="coMULTI">*/</span></div></li><li class="li2"><div class="de2"><span class="re1">.yui3-alignable-hidden</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">    <span class="kw1">visibility</span><span class="sy0">:</span><span class="kw2">hidden</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li></ol></pre></div><div class="nonumbers"><pre class="css" style="font-family:monospace;"><span class="coMULTI">/* Define absolute positioning as the default for alignable widgets */</span>
<span class="re1">.yui3-alignable</span> <span class="br0">&#123;</span>
    <span class="kw1">position</span><span class="sy0">:</span><span class="kw2">absolute</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="coMULTI">/* 
   In order to be able to position the widget when hidden, we define hidden
   to use visibility, as opposed to display
*/</span>
<span class="re1">.yui3-alignable-hidden</span> <span class="br0">&#123;</span>
    <span class="kw1">visibility</span><span class="sy0">:</span><span class="kw2">hidden</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre></div><textarea id="syntax-b4a0d7b80d345608e0ab07777b8e7f85-plain">/* Define absolute positioning as the default for alignable widgets */
.yui3-alignable {
    position:absolute;
}

/* 
   In order to be able to position the widget when hidden, we define hidden
   to use visibility, as opposed to display
*/
.yui3-alignable-hidden {
    visibility:hidden;
}</textarea></div>				</div>
				<div class="yui-u sidebar">
	
					<div id="examples" class="mod box4">
                        <div class="hd">
						<h4>
    Widget Examples:</h4>
                        </div>
						<div class="bd">
							<ul>
								<li><a href='../widget/widget-extend.html'>Extending the Base Widget Class</a></li><li class='selected'><a href='../widget/widget-build.html'>Creating Custom Widget Classes</a></li><li><a href='../widget/widget-plugin.html'>Creating a Widget Plugin</a></li><li><a href='../widget/widget-tooltip.html'>Creating a Simple Tooltip Widget</a></li><li><a href='../widget/widget-parentchild-listbox.html'>Creating a Hierarchical ListBox Widget</a></li>							</ul>
						</div>
					</div>

					<div class="mod box4">
                        <div class="hd">
						<h4>More Widget Resources:</h4>
                        </div>
                        <div class="bd">
						<ul>
							<!-- <li><a href="http://developer.yahoo.com/yui/widget/">User's Guide</a> (external)</li> -->
<li><a href="../../api/module_widget.html">API Documentation</a></li></ul>
                        </div>
					</div>
			  </div>
		</div>

		</div>
	</div>


<div class="yui-b toc3" id="tocWrapper">
<!-- TABLE OF CONTENTS -->
<div id="toc">
	
<ul>
<li class="sect first">YUI 3 Resources</li><li class="item"><a title="YUI 3 -- Yahoo! User Interface (YUI) Library" href="http://developer.yahoo.com/yui/3/">YUI 3 Web Site</a></li><li class="item"><a title="Examples of every YUI utility and control in action" href="../../examples/">YUI 3 Examples</a></li><li class="item"><a title="Instantly searchable API documentation for the entire YUI library." href="../../api/">YUI 3 API Docs</a></li><li class="item"><a title="YUI 3 Dependency Configurator -- configure your custom YUI implementation" href="http://developer.yahoo.com/yui/3/configurator/index.html">YUI 3 Dependency Configurator</a></li><li class="item"><a title="The YUI 3 Forum on YUILibrary.com" href="http://yuilibrary.com/forum/viewforum.php?f=15">YUI 3 Forums (external)</a></li><li class="item"><a title="Found a bug or a missing feature? Let us know on YUILibrary.com." href="http://developer.yahoo.com/yui/articles/reportingbugs/">Bug Reports/Feature Requests</a></li><li class="item"><a title="YUI is free and open, offered under a BSD license." href="http://developer.yahoo.com/yui/license.html">YUI License</a></li><li class="item"><a title="Download and fork the YUI project on GitHub" href="http://github.com/yui">YUI on Github</a></li><li class="item"><a title="The Yahoo! User Interface Blog" href="http://yuiblog.com">YUI Blog (external)</a></li><li class="sect">YUI 3 Core - Examples</li><li class="item"><a title="YUI Global Object - Functional Examples" href="../../examples/yui/index.html">YUI Global Object</a></li><li class="item"><a title="Event - Functional Examples" href="../../examples/event/index.html">Event</a></li><li class="item"><a title="Node - Functional Examples" href="../../examples/node/index.html">Node</a></li><li class="sect">YUI 3 Component Infrastructure - Examples</li><li class="item"><a title="Attribute - Functional Examples" href="../../examples/attribute/index.html">Attribute</a></li><li class="item"><a title="Plugin - Functional Examples" href="../../examples/plugin/index.html">Plugin</a></li><li class="selected "><a title="Widget - Functional Examples" href="../../examples/widget/index.html">Widget</a></li><li class="sect">YUI 3 Utilities - Examples</li><li class="item"><a title="Animation - Functional Examples" href="../../examples/anim/index.html">Animation</a></li><li class="item"><a title="AsyncQueue - Functional Examples" href="../../examples/async-queue/index.html">AsyncQueue</a></li><li class="item"><a title="Cache - Functional Examples" href="../../examples/cache/index.html">Cache</a></li><li class="item"><a title="Cookie - Functional Examples" href="../../examples/cookie/index.html">Cookie</a></li><li class="item"><a title="DataSchema - Functional Examples" href="../../examples/dataschema/index.html">DataSchema <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="item"><a title="DataSource - Functional Examples" href="../../examples/datasource/index.html">DataSource <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="item"><a title="DataType - Functional Examples" href="../../examples/datatype/index.html">DataType <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="item"><a title="Drag &amp; Drop - Functional Examples" href="../../examples/dd/index.html">Drag &amp; Drop</a></li><li class="item"><a title="Get - Functional Examples" href="../../examples/get/index.html">Get</a></li><li class="item"><a title="History - Functional Examples" href="../../examples/history/index.html">History <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="item"><a title="IO - Functional Examples" href="../../examples/io/index.html">IO</a></li><li class="item"><a title="ImageLoader - Functional Examples" href="../../examples/imageloader/index.html">ImageLoader</a></li><li class="item"><a title="Internationalization - Functional Examples" href="../../examples/intl/index.html">Internationalization</a></li><li class="item"><a title="JSON (JavaScript Object Notation) - Functional Examples" href="../../examples/json/index.html">JSON</a></li><li class="item"><a title="JSONP (JSON with Padding) - Functional Examples" href="../../examples/jsonp/index.html">JSONP <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="item"><a title="Recordset - Functional Examples" href="../../examples/recordset/index.html">Recordset <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="item"><a title="Resize - Functional Examples" href="../../examples/resize/index.html">Resize <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="item"><a title="Sortable - Functional Examples" href="../../examples/sortable/index.html">Sortable <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="item"><a title="Stylesheet - Functional Examples" href="../../examples/stylesheet/index.html">Stylesheet</a></li><li class="item"><a title="Transition - Functional Examples" href="../../examples/transition/index.html">Transition <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="item"><a title="Uploader - Functional Examples" href="../../examples/uploader/index.html">Uploader <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="item"><a title="YQL Query - Functional Examples" href="../../examples/yql/index.html">YQL Query <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="sect">YUI 3 Widgets - Examples</li><li class="item"><a title="AutoComplete - Functional Examples" href="../../examples/autocomplete/index.html">AutoComplete <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="item"><a title="Charts - Functional Examples" href="../../examples/charts/index.html">Charts <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="item"><a title="DataTable - Functional Examples" href="../../examples/datatable/index.html">DataTable <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="item"><a title="Dial - Functional Examples" href="../../examples/dial/index.html">Dial <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="item"><a title="Editor - Functional Examples" href="../../examples/editor/index.html">Editor <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="item"><a title="Overlay - Functional Examples" href="../../examples/overlay/index.html">Overlay <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="item"><a title="ScrollView - Functional Examples" href="../../examples/scrollview/index.html">ScrollView <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="item"><a title="Slider - Functional Examples" href="../../examples/slider/index.html">Slider <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="item"><a title="TabView - Functional Examples" href="../../examples/tabview/index.html">TabView <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="sect">YUI 3 Node Plugins - Examples</li><li class="item"><a title="FocusManager Node Plugin - Functional Examples" href="../../examples/node-focusmanager/index.html">FocusManager Node Plugin <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="item"><a title="MenuNav Node Plugin - Functional Examples" href="../../examples/node-menunav/index.html">MenuNav Node Plugin <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="sect">YUI 3 CSS - Examples</li><li class="item"><a title="YUI Base - Functional Examples" href="../../examples/cssbase/index.html">CSS Base</a></li><li class="item"><a title="YUI Fonts - Functional Examples" href="../../examples/cssfonts/index.html">CSS Fonts</a></li><li class="item"><a title="YUI Grids - Functional Examples" href="../../examples/cssgrids/index.html">CSS Grids <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="item"><a title="YUI CSS Reset - Functional Examples" href="../../examples/cssreset/index.html">CSS Reset</a></li><li class="sect">YUI 3 Developer Tools - Examples</li><li class="item"><a title="Console - Functional Examples" href="../../examples/console/index.html">Console <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="item"><a title="Console Filters Plugin- Functional Examples" href="../../examples/console-filters/index.html">Plugin.ConsoleFilters <img alt='beta' src='http://l.yimg.com/a/i/not/beta_1.gif'></a></li><li class="item"><a title="Profiler - Functional Examples" href="../../examples/profiler/index.html">Profiler</a></li><li class="item"><a title="Test - Functional Examples" href="../../examples/test/index.html">Test</a></li><li class="sect">Other Useful YUI 3 Resources</li><li class="item"><a title="Answers to Frequently Asked Questions about the YUI Library" href="http://developer.yahoo.com/yui/articles/faq/">YUI FAQ (external)</a></li><li class="item"><a title="Yahoo!'s philosophy of Graded Browser Support" href="http://developer.yahoo.com/yui/articles/gbs/">Graded Browser Support (external)</a></li><li class="item"><a title="Videos and podcasts from the YUI Team and from the Yahoo! frontend engineering community." href="http://developer.yahoo.com/yui/theater/">YUI Theater (external)</a></li></ul>
</div>
</div>
	</div><!--closes bd-->

	<div id="ft">
        <p class="first">Copyright &copy; 2011 Yahoo! Inc. All rights reserved.</p>
        <p><a href="http://privacy.yahoo.com/privacy/us/devel/index.html">Privacy Policy</a> - 
            <a href="http://docs.yahoo.com/info/terms/">Terms of Service</a> - 
            <a href="http://docs.yahoo.com/info/copyright/copyright.html">Copyright Policy</a> - 
            <a href="http://careers.yahoo.com/">Job Openings</a></p>
	</div>
</div>
<script language="javascript"> 
var yuiConfig = { filter: 'raw' };
</script>
<script src="../../assets/syntax.js"></script>
<script src="../../assets/dpSyntaxHighlighter.js"></script>
<script language="javascript"> 
dp.SyntaxHighlighter.HighlightAll('code'); 
</script>
</body>
</html>
